<template>
  <div id="top-head">
    <div class="left">
      <div>
        <el-button size="mini" @click="chageCollapse" fit="fill" icon="el-icon-menu"></el-button>
      </div>
      <el-breadcrumb separator="/">
        <el-breadcrumb-item 
          v-for="item in tags" 
          :key="item.path" 
          :to="{ path: item.path }"
        >
          {{item.label}}
        </el-breadcrumb-item>
      </el-breadcrumb>
    </div>
    <div class="right"> 
      <el-dropdown trigger="click">
        <div>
          <el-image :src="img"></el-image>
        </div>
        <el-dropdown-menu slot="dropdown">
          <el-dropdown-item>个人中心</el-dropdown-item>
          <el-dropdown-item>登出</el-dropdown-item>
        </el-dropdown-menu>
      </el-dropdown>
    </div>
  </div>
</template>

<script>
import { mapState} from 'vuex';
export default {
  name: "TopHead",
  data() {
    return {
      img: require("@/assets/img/002.jpeg")
    }
  },
  computed: {
    ...mapState({
      tags: state => state.tab.tabList
    })
  },
  methods: {
    chageCollapse() {
      this.$store.commit("changeCollapse")
    }
  }
}
</script>

<style lang="less" scoped>
#top-head {
  background-color: #333;
  height: 100%;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.left {
  margin-left: 10px;
  height: 60px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  .el-breadcrumb {
    margin-left: 10px;
  }
  /deep/ .el-breadcrumb__inner {
    color: rgb(187, 183, 183);
  }
  /deep/ .el-breadcrumb__inner:hover {
    color: #fff;
    cursor: pointer;
  }
}
.right {
  margin-right: 20px;
  .el-image {
    width: 40px;
    height: 40px;
    border-radius: 50%;
  }
}
</style>